import React, { Component } from 'react';
import { observer } from 'mobx-react'
import { View } from 'react-native';
import styles from './styles';
import CheckMobile from './components/checkMob';

@observer
class Login extends Component {
  submitHandle = values => {
    this.props.user.login(values);
  };
  sendHandle = (mobile, action) => {
    this.props.user.sendSmsCode(mobile, action);
  };
  render() {
    return (
      <View style={[styles.content]}>
        <CheckMobile
          sendAction={this.sendHandle}
          onSubmit={this.submitHandle}
          sendError={this.props.user.sendError}
          submitText="登录"
          action={1}
        />
      </View>
    );
  }
}
export default Login
